#ifndef ELPALETTE_H
#define ELPALETTE_H

#include <QColor>
#include <QMap>

class ElPalette
{
public:
    // Inactive apply to ElSwitch
    enum ColorGroup { Inactive, Normal, Entered, Pressed, Disabled };
    enum ColorRole { Background, Foreground, Border, Shadow };

    ElPalette();

    ElPalette &toggleColorGroup(ColorGroup colorGroup);
    ColorGroup currentColorGroup() const;

    ElPalette &setColor(ColorGroup colorGroup, ColorRole colorRole, const QColor &color);
    QColor color(ColorGroup colorGroup, ColorRole colorRole) const;

    ElPalette &setColor(ColorRole colorRole, const QColor &color)
    {
        return setColor(_currentColorGroup, colorRole, color);
    }
    QColor color(ColorRole colorRole) const { return color(_currentColorGroup, colorRole); }

private:
    ColorGroup _currentColorGroup = Normal;
    QMap<std::pair<ColorGroup, ColorRole>, QColor> _colors;
};

#endif // ELPALETTE_H
